package com.wolfcode.controller;

import com.wolfcode.pojo.User;
import com.wolfcode.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author yinyin
 * @create 2022/08/27 下午 7:30
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("selectUserById/{id}")
    @ResponseBody
    public User selectUserById(@PathVariable("id") Integer id){
        return userService.selectUserById(id);
    }

    @GetMapping("user/list")
    public  String userList(){
        return "user/list";
    }
}
